<?xml version='1.0' encoding='UTF-8' ?> 
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:p="http://primefaces.prime.com.tr/ui"
      xmlns:f="http://java.sun.com/jsf/core">

    <h:head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
        <link href="../../resources/css/default.css" rel="stylesheet" type="text/css" />
        <link href="../../resources/css/cssLayout.css" rel="stylesheet" type="text/css" />
        <link href="../../stylesheet/default.css" rel="stylesheet" type="text/css" />
        <link type="text/css" rel="stylesheet" href="../../theme/start/theme.css"/>
        <ui:insert name="head-title">
            <title>Merlion ERP System</title>
        </ui:insert>
    </h:head>

    <h:body>

        <div id="top">
            <ui:insert name="top"><a href="../index.xhtml"><img src="../../images/topbanner.png" width="100%" height="100%"/></a>
                <h:form>
                    <p:menubar autoSubmenuDisplay="true" style="background-color: #123456" rendered="#{!controller.firstLogin}">
                        <p:submenu label="Profile" icon="ui-icon ui-icon-newwin">  
                            <p:menuitem value="View Profile" url="../profile/viewProfile.xhtml" /> 
                            <p:menuitem value="Edit Profile" url="../profile/editProfile.xhtml" /> 
                            <p:menuitem value="Change Password" url="../profile/changePassword.xhtml" />  
                            <p:menuitem value="View Global List" url="../profile/viewGlobalList.xhtml" /> 
                            <p:menuitem value="View Contact List" url="../profile/viewContactList.xhtml" />                             
                        </p:submenu>
                        <p:submenu label="Position" icon="ui-icon ui-icon-newwin" rendered="#{controller.admin}">  
                            <p:menuitem value="Add Position" url="../position/addPosition.xhtml" rendered="#{controller.adminCreatable}"/>  
                            <p:menuitem value="View Positions" url="../position/viewPosition.xhtml" rendered="#{controller.adminViewable}"/>                             
                        </p:submenu>

                        <p:submenu label="Employee" icon="ui-icon ui-icon-newwin" rendered="#{controller.admin}">
                            <p:menuitem value ="Add Employee" url ="../employee/addEmployee.xhtml" rendered="#{controller.adminCreatable}"/>
                            <p:menuitem value ="View Employees" url ="../employee/viewEmployee.xhtml" rendered="#{controller.adminViewable}"/>
                        </p:submenu>

                        <p:submenu label="Customer Management" icon="ui-icon ui-icon-folder-open" rendered="#{controller.CRMStaff}">
                            <p:submenu label="Sale Lead" icon="ui-icon ui-icon-newwin" rendered="#{controller.CRMStaff}">  
                                <p:menuitem value="Add Sale Lead" url="../salelead/addSaleLead.xhtml" rendered="#{controller.CRMCreatable}"/>  
                                <p:menuitem value="View Sale Leads" url="../salelead/viewSaleLead.xhtml" rendered="#{controller.CRMViewable}"/>  
                            </p:submenu>  
                            <p:submenu label="Customer" icon="ui-icon ui-icon-newwin" rendered="#{controller.CRMStaff}">  
                                <p:menuitem value="Add Customer" url="../customer/addCustomer.xhtml" rendered="#{controller.CRMCreatable}"/> 
                                <p:menuitem value="View Customers" url ="../customer/viewCustomer.xhtml" rendered="#{controller.CRMViewable}"/>
                            </p:submenu>
                        </p:submenu>

                        <p:submenu label="Credit Control Management" icon="ui-icon ui-icon-folder-open" rendered="#{controller.FRMStaff}">
                            <p:submenu label="Credit Account" icon="ui-icon ui-icon-newwin" rendered="#{controller.FRMStaff}">  
                                <p:menuitem value="View Customer's Credit Account" url="../creditAccount/viewCreditAccount.xhtml" rendered="#{controller.FRMViewable}"/>
                                <p:menuitem value ="Add Deposit" url="../deposit/addDeposit.xhtml"/>
                            </p:submenu>                                                                
                        </p:submenu>

                        <p:submenu label="Billing and Payment Management" icon="ui-icon ui-icon-folder-open" rendered="#{controller.FRMStaff}">
                            <p:submenu label="Customer" icon="ui-icon ui-icon-newwin" rendered="#{controller.FRMStaff}">  
                                <p:submenu label="Invoice" icon="ui-icon ui-icon-newwin" rendered="#{controller.FRMStaff}">
                                    <p:menuitem value="Create Invoice" url="../customerInvoice/successDeliveryOrder.xhtml" rendered="#{controller.FRMStaff}"/>
                                    <p:menuitem value="View All Invoices" url="../customerInvoice/viewAllCustomerInvoices.xhtml"/>
                                    <p:menuitem value="View Customer's Invoices" url="../customerInvoice/viewCustomerInvoices.xhtml"/>
                                </p:submenu>

                                <p:submenu label="Payment" icon="ui-icon ui-icon-newwin" rendered="#{controller.FRMStaff}">
                                    <p:menuitem value="Create Payment for Customer" url="../customerPayment/addCustomerPayment.xhtml" rendered="#{controller.FRMViewable}"/>
                                    <p:menuitem value="View All Payments" url="../customerPayment/viewAllCustomerPayments.xhtml"/>
                                    <p:menuitem value="View Customer's Payments" url="../customerPayment/viewCustomerPayments.xhtml"/>
                                </p:submenu>
                            </p:submenu>

                            <p:submenu label="Supplier" icon="ui-icon ui-icon-newwin" rendered="#{controller.FRMStaff}">  
                                <p:submenu label="Invoice" icon="ui-icon ui-icon-newwin" rendered="#{controller.FRMStaff}">
                                    <p:menuitem value="Create Invoice" url="../supplierInvoice/addSupplierInvoice.xhtml"/>
                                    <p:menuitem value="View All Invoices" url="../supplierInvoice/viewAllSupplierInvoices.xhtml"/>
                                    <p:menuitem value="View Supplier's Invoices" url="../supplierInvoice/viewSupplierInvoices.xhtml"/>
                                </p:submenu>

                                <p:submenu label="Payment" icon="ui-icon ui-icon-newwin" rendered="#{controller.FRMStaff}">
                                    <p:menuitem value="Make Payment for Supplier" url="../supplierPayment/addSupplierPayment.xhtml" rendered="#{controller.FRMViewable}"/>
                                    <p:menuitem value="View All Payments" url="../supplierPayment/viewAllSupplierPayments.xhtml"/>
                                    <p:menuitem value="View Supplier's Payments" url="../supplierPayment/viewSupplierPayments.xhtml"/>
                                </p:submenu>
                            </p:submenu>
                        </p:submenu>

                        <p:submenu label="Products" icon="ui-icon ui-icon-folder-open" rendered="#{controller.CRMStaff}">
                            <p:submenu label="Prices" icon="ui-icon ui-icon-newwin" rendered="#{controller.CRMStaff}">  
                                <p:menuitem value="Add New Price" url="../productPrice/addProductPrice.xhtml" rendered="#{controller.CRMCreatable}" />  
                                <p:menuitem value="View Prices" url="../productPrice/viewProductPrice.xhtml" rendered="#{controller.CRMViewable}"/>                             
                            </p:submenu> 
                            <p:submenu label="Discounts" icon="ui-icon ui-icon-newwin" rendered="#{controller.CRMStaff}">  
                                <p:menuitem value="Add Discount" url="../discount/addDiscount.xhtml" rendered="#{controller.CRMCreatable}"/> 
                                <p:menuitem value="View Discounts" url="../discount/viewDiscount.xhtml" rendered="#{controller.CRMViewable}"/>
                            </p:submenu>
                        </p:submenu>

                        <p:submenu label="Sales Order Processing" icon="ui-icon ui-icon-folder-open" rendered="#{controller.CRMStaff}" >
                            <p:submenu label="Sale Inquiry" icon="ui-icon ui-icon-newwin" rendered="#{controller.CRMStaff}">
                                <p:menuitem value="Add Sale Inquiry" url="../saleinquiry/addSaleInquiry.xhtml" rendered="#{controller.CRMCreatable}"/>
                                <p:menuitem value="View Sale Inquiries" url="../saleinquiry/viewSaleInquiry.xhtml" rendered="#{controller.CRMViewable}"/> 
                            </p:submenu>
                            <p:submenu label="Sale Quotation" icon="ui-icon ui-icon-newwin" rendered="#{controller.CRMStaff}">
                                <p:menuitem value="Add Sale Quotation" url="../salequotation/addSaleQuotation.xhtml" rendered="#{controller.CRMCreatable}"/>
                                <p:menuitem value="View Sale Quotations" url="../salequotation/viewSaleQuotation.xhtml" rendered="#{controller.CRMViewable}"/> 
                            </p:submenu>
                            <p:submenu label="Sale Order" icon="ui-icon ui-icon-newwin" rendered="#{controller.CRMStaff}">  
                                <p:menuitem value="View Sale Orders" url="../saleorder/viewSaleOrder.xhtml" rendered="#{controller.CRMViewable}"/> 
                            </p:submenu>
                        </p:submenu>

                        <p:submenu label="Balance Record" icon="ui-icon ui-icon-folder-open" rendered="#{controller.SCMStaff}">
                            <p:menuitem value="Product Balance" url="../balance/viewProductBalance.xhtml" rendered="#{controller.SCMViewable}"/>
                            <p:menuitem value="Material Balance" url="../balance/viewMaterialBalance.xhtml" rendered="#{controller.SCMViewable}"/>                       
                        </p:submenu>
                        <p:submenu label="Inbound Control" icon="ui-icon ui-icon-folder-open" rendered="#{controller.SCMStaff}">
                            <p:submenu label="Inventory" icon="ui-icon ui-icon-folder-open" rendered="#{controller.SCMStaff}">
                                <p:submenu label="Product Batch" icon="ui-icon ui-icon-newwin" rendered="#{controller.SCMStaff}">
                                    <p:menuitem value="Add New Batch" url="../productBatch/addProductBatch.xhtml" rendered="#{controller.SCMCreatable}"/>
                                    <p:menuitem value="View Product Batch" url="../productBatch/viewProductBatch.xhtml" rendered="#{controller.SCMViewable}"/>
                                </p:submenu>
                            </p:submenu>

                            <p:submenu label="Raw Material" icon="ui-icon ui-icon-folder-open" rendered="#{controller.SCMStaff}">
                                <p:submenu label="Material Batch" icon="ui-icon ui-icon-newwin" rendered="#{controller.SCMStaff}">
                                    <p:menuitem value="Add New Batch" url="../materialBatch/addMaterialBatch.xhtml" rendered="#{controller.SCMCreatable}"/>
                                    <p:menuitem value="View Material Batch" url="../materialBatch/viewMaterialBatch.xhtml" rendered="#{controller.SCMViewable}"/>
                                </p:submenu>
                            </p:submenu>
                        </p:submenu>

                        <p:submenu label="Outbound Control" icon="ui-icon ui-icon-folder-open" rendered="#{controller.SCMStaff}">
                            <p:submenu label="Inventory" icon="ui-icon ui-icon-folder-open" rendered="#{controller.SCMStaff}">
                                <p:submenu label="Delivery Order" icon="ui-icon ui-icon-newwin" >
                                    <p:menuitem value="Create Delivery Order" url="../deliveryOrder/viewConfirmedSaleOrder.xhtml" rendered="#{controller.SCMCreatable}"/>
                                    <p:menuitem value="Pending Delivery Orders" url="../deliveryOrder/pendingDeliveryOrder.xhtml" rendered="#{controller.SCMCreatable}"/>
                                    <p:menuitem value="View Delivery Orders" url="../deliveryOrder/viewDeliveryOrder.xhtml" rendered="#{controller.SCMViewable}"/>
                                </p:submenu>

                                <p:submenu label="Picking Order" icon="ui-icon ui-icon-newwin" >
                                    <p:menuitem value="Pending Picking Order" url="../pickingOrder/pendingPickingOrder.xhtml" rendered="#{controller.SCMCreatable}"/>
                                    <p:menuitem value="View Picking Order" url="../pickingOrder/viewPickingOrder.xhtml" rendered="#{controller.SCMViewable}"/>
                                </p:submenu>
                                <p:submenu label="Packing Order" icon="ui-icon ui-icon-newwin" >
                                    <p:menuitem value="Pending Packing Order" url="../packingOrder/pendingPackingOrder.xhtml" rendered="#{controller.SCMCreatable}"/>
                                    <p:menuitem value="View Packing Order" url="../packingOrder/viewPackingOrder.xhtml" rendered="#{controller.SCMViewable}"/>
                                </p:submenu>
                                <p:submenu label="Shipping Order" icon="ui-icon ui-icon-newwin" >
                                    <p:menuitem value="Pending Shipping Order" url="../shippingOrder/pendingShippingOrder.xhtml" rendered="#{controller.SCMCreatable}"/>
                                    <p:menuitem value="View Shipping Order" url="../shippingOrder/viewShippingOrder.xhtml" rendered="#{controller.SCMViewable}"/>
                                </p:submenu>
                            </p:submenu>


                            <p:submenu label="Raw Material" icon="ui-icon ui-icon-folder-open" rendered="#{controller.SCMStaff}">
                                <p:submenu label="Material Request" icon="ui-icon ui-icon-newwin" rendered="#{controller.SCMStaff}">
                                    <p:menuitem value="Convert To Materimal Request" url="../materialRequest/viewWeeklyRequestFromMRP.xhtml" rendered="#{controller.SCMCreatable}"/>
                                    <p:menuitem value="Arrived Material Request" url="../materialRequest/viewArrivedMaterialRequest.xhtml" rendered="#{controller.SCMCreatable}"/>
                                    <p:menuitem value="Success Material Request" url="../materialRequest/viewSuccessMaterialRequest.xhtml" rendered="#{controller.SCMCreatable}"/>
                                    <p:menuitem value="View Material Request" url="../materialRequest/viewMaterialRequest.xhtml" rendered="#{controller.SCMViewable}"/>
                                </p:submenu>
                            </p:submenu>
                        </p:submenu>
                        
                        <p:submenu label="Raw Material Purchasing" icon="ui-icon ui-icon-newwin" rendered="#{controller.SCMStaff}">
                            <p:submenu label="Create Material Purchasing Order" icon="ui-icon ui-icon-newwin" rendered="#{controller.SCMStaff}">
                                <p:menuitem value="Create from Material Request" url="../materialOrder/addMaterialOrder.xhtml"/>
                                <p:menuitem value="Create Directly" url="../materialOrder/createMaterialOrderDirectly.xhtml" />
                            </p:submenu>
                            <p:menuitem value="View Material Order" url="../materialOrder/viewMaterialOrder.xhtml" /> 
                            <p:menuitem value="Change Material Request State" url="../materialOrder/changeState.xhtml" />
                        </p:submenu>

                        <p:submenu label="Supplier Management" icon="ui-icon ui-icon-newwin" rendered="#{controller.SCMStaff}">  
                            <p:menuitem value="Add Supplier" url="../supplier/addSupplier.xhtml" />
                            <p:menuitem value="View Supplier" url="../supplier/viewSupplier.xhtml" /> 
                        </p:submenu>

                        <p:submenu label="Production Plan" icon="ui-icon ui-icon-newwin" rendered="#{controller.MRPStaff}">
                            <p:menuitem value="Add Production Plan" url="../productionplan/addProductionPlan.xhtml"/>
                            <p:menuitem value="Add Holiday" url="../holiday/holiday.xhtml"/>
                        </p:submenu>

                        <p:submenu label="Sale Figure" icon="ui-icon ui-icon-newwin" rendered="#{controller.MRPStaff}">
                            <p:menuitem value="View Sale Figure" url="../salefigure/viewSaleFigures.xhtml"/>
                        </p:submenu>

                        <p:submenu label="Sale Forecast" icon="ui-icon ui-icon-newwin" rendered="#{controller.MRPStaff}">
                            <p:menuitem value="View Sale Forecast" url="../saleforecast/viewSaleForecasts.xhtml"/>
                        </p:submenu>

                        <p:submenu label="Material Requirement" icon="ui-icon ui-icon-newwin" rendered="#{controller.MRPStaff}">
                            <p:menuitem value="View Weekly Material Requirement" url="../materialrequirement/viewWeeklyMaterialRequirement.xhtml"/>
                        </p:submenu>





                        <p:menuitem value="Log Out" actionListener="#{controller.logOut()}" icon="ui-icon ui-icon-close" />                      

                        <p:menubar autoSubmenuDisplay="true" style="background-color: #123456" rendered="#{!controller.firstLogin}">
                            <p:submenu label="Profile" icon="ui-icon ui-icon-newwin">  
                                <p:menuitem value="View Profile" url="../profile/viewProfile.xhtml" /> 
                                <p:menuitem value="Edit Profile" url="../profile/editProfile.xhtml" /> 
                                <p:menuitem value="Reset Password" url="resetPassword.xhtml" />
                            </p:submenu>
                            <p:menuitem value="Log Out" actionListener="#{controller.logOut()}" icon="ui-icon ui-icon-close" /> 
                        </p:menubar>
                    </p:menubar>
                </h:form>
            </ui:insert>
        </div>
        <div>
            <table style="border-style: none; border-spacing: 0px;width: 100%">
                <tr>
                    <td id="leftcontent" class="left_content" style="width: 20%; background-color: white;" valign="top">
                        <p:panel>

                            <b>Announcements</b> <a href="index.xhtml">(View All)</a>

                        </p:panel>
                        <p:panel>

                            <b>Messages</b> <a href="../messageMe.xhtml">(View All)</a>

                        </p:panel>
                     
                        <p:panel header="Shortcuts" rendered="#{controller.admin}"> 
                            <a href="../position/addPosition.xhtml">Add Position</a>
                            <br/><a href="../position/viewPosition.xhtml">View Positions</a>
                            <br/><a href="../employee/addEmployee.xhtml">Add Employee</a>
                            <br/><a href="../employee/viewEmployee.xhtml">View Employees</a>
                            <br/>
                        </p:panel> 
                        <p:panel header="Shortcuts" rendered="#{controller.CRMStaff}"> 
                            <a href="../salelead/viewSaleLead.xhtml">View Sale Leads</a>
                            <br/><a href="../customer/viewCustomer.xhtml">View Customers</a>
                            <br/><a href="../saleinquiry/viewSaleInquiry.xhtml">View Sale Inquiries</a>
                            <br/><a href="../salequotation/viewSaleQuotation.xhtml">View Sale Quotations</a>
                            <br/><a href="../saleorder/viewSaleOrder.xhtml">View Sale Orders</a>
                            <br/>
                        </p:panel> 
                        <p:panel header="Shortcuts" rendered="#{controller.FRMStaff}"> 
                            <a href="../creditAccount/viewCreditAccount.xhtml">View Credit Account</a>
                            <br/><a href="../customerInvoice/viewAllCustomerInvoices.xhtml">View All Customer's Invoices</a>
                            <br/><a href="../supplierInvoice/addSupplierInvoice.xhtml">Add Supplier's Invoice</a>
                            <br/><a href="../supplierPayment/addSupplierPayment.xhtml">Add Supplier's Payment</a>
                            <br/><a href="../customerPayment/addCustomerPayment.xhtmll">Add Customer's Payment</a>
                            <br/>
                        </p:panel> 
                        <p:panel header="Shortcuts" rendered="#{controller.MRPStaff}"> 
                            <a href="../salefigure/viewSaleFigures.xhtml">View Sale Figures</a>
                            <br/><a href="../saleforecast/viewSaleForecasts.xhtml">View Sale Forecasts</a>
                            <br/><a href="../productionplan/addProductionPlan.xhtml">View Production Plan</a>
                            <br/><a href="../materialrequirement/viewWeeklyMaterialRequirement.xhtml">View Weekly Material Requirement</a>
                            <br/>
                        </p:panel> 
                        <p:panel header="Shortcuts" rendered="#{controller.SCMStaff}"> 
                            <a href="../supplier/viewSupplier.xhtml">View Supplier</a>
                            <br/><a href="../materialOrder/viewMaterialOrder.xhtml">View Material Order</a>
                            <br/><a href="../deliveryOrder/pendingDeliveryOrder.xhtml">View Pending Delivery Order</a>
                            <br/><a href="../materialRequest/viewArrivedMaterialRequest.xhtml">Arrived Material Request</a>
                            <br/>
                        </p:panel> 
                        
                        
                        
                        
                        
                     <f:view beforePhase="#{todoListManagerBean.initView}">
                        <h:form>
                            <p:dataTable value="#{todoListManagerBean.todoLists}" var="todoList">
                                <f:facet name="header">
                                    To-do List
                                    <a href="../todoList.xhtml">(View All)</a>
                                </f:facet>
                                <p:column>
                                    <h:outputText value="#{todoList.task}"/>
                                </p:column>
                            </p:dataTable>
                        </h:form>
                    </f:view>
                 
                        
                        
                        
                    </td>
                    <td id="content" class="right_content" style="width: 80%;" valign="top">
                        <ui:insert name="content">
                            Please insert content here!
                        </ui:insert>
                    </td>
                </tr>
            </table>
        </div>
        <div id="bottom" class="right_content" style="margin-top: 0px;">
            <ui:insert name="bottom">
                <p class="copyright">Copyright © 2011 Merlion Food Limited. All rights reserved.</p>   
            </ui:insert>
        </div>
    </h:body>

</html>
